package cn.edu.tju.elm.dto;

import java.time.LocalDateTime;

/**
 * ClassName: ComplainResponseDTO
 * Package: cn.edu.tju.elm.dto
 * Description: 投诉响应DTO
 *
 * @Author System
 * @Create 2025/10/31
 * @Version 1.0
 */
public class ComplainResponseDTO {

    private Long id;
    private Long orderId;
    private Long customerId;
    private String customerUsername;
    private Long businessId;
    private String businessName;
    private String content;
    private Integer state;
    private String stateDescription;
    private String businessReply;
    private String adminReply;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    private Boolean deleted;

    public ComplainResponseDTO() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getCustomerUsername() {
        return customerUsername;
    }

    public void setCustomerUsername(String customerUsername) {
        this.customerUsername = customerUsername;
    }

    public Long getBusinessId() {
        return businessId;
    }

    public void setBusinessId(Long businessId) {
        this.businessId = businessId;
    }

    public String getBusinessName() {
        return businessName;
    }

    public void setBusinessName(String businessName) {
        this.businessName = businessName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
        // 自动设置状态描述
        this.stateDescription = getStateDescriptionByCode(state);
    }

    public String getStateDescription() {
        return stateDescription;
    }

    public void setStateDescription(String stateDescription) {
        this.stateDescription = stateDescription;
    }

    public String getBusinessReply() {
        return businessReply;
    }

    public void setBusinessReply(String businessReply) {
        this.businessReply = businessReply;
    }

    public String getAdminReply() {
        return adminReply;
    }

    public void setAdminReply(String adminReply) {
        this.adminReply = adminReply;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    private String getStateDescriptionByCode(Integer state) {
        if (state == null) {
            return "未知状态";
        }
        switch (state) {
            case 0:
                return "待审核";
            case 1:
                return "商家已拒绝";
            case 2:
                return "已通过";
            case 3:
                return "管理员已拒绝";
            default:
                return "未知状态";
        }
    }
}

